# -*- coding:utf-8 -*-
# @Time:2024/4/1921:01
# @Author:miuzg
# @FileName:new test2.py
# @Software:PyCharm
import time

from multiprocessing import Process
from threading import Thread

# 将要子进程执行的任务写成函数
def fun():
    print('fun函数开始开始')
    time.sleep(2)
    print('fun函数结束结束')

if __name__ == '__main__':
    # 通过Process/Thread创建对应的进程，线程对象
    p = Process(target=fun)
    p.start()
    print('main函数运行')